<?php
// 设置搜索顺序，
// 拼装sql语句

// 设置排序
if ($_REQUEST['sortby'] == "") {
    $_sortby = "nid";
} else {
    $_sortby = $_REQUEST['sortby'];
}

if ($_REQUEST['sortorder'] == "") {
    $_sortorder = "desc";
} else {
    $_sortorder = $_REQUEST['sortorder'];
}

// 添加特殊排序条件（始终应用）
//$specialSort = "FIELD(`pay_status`, '2', '0', '1', '3') {$_sortorder}, ";

// 拼接最终的排序语句

    $sort = $specialSort . $_sortby . " " . $_sortorder;

